import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;

import stub.Warehouse;


public class Main{
	
	public static void main( String[] args ) {
		String host = ( args.length < 1 ) ? null : args[0];
		try{
			Registry registry = LocateRegistry.getRegistry( host );
			// Get the warehouse
			Warehouse stub = ( Warehouse ) registry.lookup( "Warehouse" );
			
			// Start the client
			new Client( stub );
			
		} catch( Exception e ){
			System.err.println( "Client exception: " + e.toString() );
			e.printStackTrace();
		}
	}
}
